Skip to content

refactor(examlense): reorganize backend into package-by-feature slices#13

Merged
zhngharry merged 1 commit into
mainfrom
reorganize-examlens-backend-structure
Jul 15, 2026
Merged

refactor(examlense): reorganize backend into package-by-feature slices#13
zhngharry merged 1 commit into
mainfrom
reorganize-examlens-backend-structure

Conversation

@zhngharry

Copy link
Copy Markdown
Contributor

Converge the backend on package-by-feature vertical slices. Dissolve the layer-based api/ and persistence/ packages: each domain (exam, section, task, grading, admin) now owns its controller + service + entity + repository + DTOs, alongside the existing parse/solve/lgh slices. Keep cross-cutting technical modules shared (ai, storage, sse, security, config, error, prompts) and add a shared/ package for Access, Patch, and DefaultUser.

Split the monolithic Dtos.java into per-slice DTO holders and the cross-domain CrudService into ExamService/SectionService/TaskService. Pure package reshuffle: no endpoint paths or DB schema change. Relocate tests beside their subjects and update the backend README project layout.

Converge the backend on package-by-feature vertical slices. Dissolve the
layer-based api/ and persistence/ packages: each domain (exam, section, task,
grading, admin) now owns its controller + service + entity + repository + DTOs,
alongside the existing parse/solve/lgh slices. Keep cross-cutting technical
modules shared (ai, storage, sse, security, config, error, prompts) and add a
shared/ package for Access, Patch, and DefaultUser.

Split the monolithic Dtos.java into per-slice DTO holders and the cross-domain
CrudService into ExamService/SectionService/TaskService. Pure package reshuffle:
no endpoint paths or DB schema change. Relocate tests beside their subjects and
update the backend README project layout.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@zhngharry
zhngharry requested review from florivn and yinggez July 15, 2026 13:02

@yinggez yinggez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot:

✅ Architecture Refactoring Approved

Excellent execution of a complex package reorganization. The move from layer-based (api/, persistence/) to vertical slices is clean and well-structured.
Strengths:

  • Clear ownership: Each domain slice (exam, section, task, grading, admin) owns its full stack (controller + service + entity + repo + DTOs)
  • Reduced coupling: Cross-cutting modules (ai, storage, sse, security, config, error, prompts) properly centralized; no layer-based bottlenecks
  • Focused services: CrudService decomposed into ExamService, SectionService, TaskService — each single-purpose
  • Monolithic DTO split: Dtos.java eliminated; each slice holds focused DTO records (ExamDtos, SectionDtos, TaskDtos, etc.)
  • Import consistency: All 72 files correctly updated; no dangling or broken references
  • Tests relocated: All tests co-located with their subjects; naming and structure clear
  • Transaction safety preserved: @transactional annotations and atomic operations intact across all services
  • No functional changes: Pure restructuring — no endpoint paths or DB schema changes as promised
  • Follows existing pattern: Aligns cleanly with parse/, solve/, lgh/ slices already in the codebase

Minor: SectionService handles both sections and blocks; consider adding a note in the docstring explaining the operational coupling if future maintainers find this non-obvious.

Ready to merge. 🚀

@zhngharry
zhngharry merged commit d060799 into main Jul 15, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants